<template>
    <div class="menu">
        <p>{{msg}}</p>
        <ul>
            <li v-for="(item,key) of list2" :key="key" >
                <router-link :to="'/getContent?aid='+key">{{item}}</router-link>
            </li>
        </ul>
        <ul>
            <li v-for="(item,key) of list" :key="key" >
                <router-link :to="'/content/'+key">{{item}}</router-link>
            </li>
        </ul>
        <ul>
            <li v-for="(item,key) of list3" :key="key" >
                <router-link :to="'/newsContent/'+item.aid">{{item.title}}</router-link>
            </li>
        </ul>
    </div>
</template>

<script>


export default {
    data () {
        return {
            msg: '菜单详情(两种不同路由传参方式)',
            list: ['图书菜单0','图书菜单1','图书菜单2'],
            list2: ['商品菜单0','商品菜单1','商品菜单2'],
            list3: ['新闻菜单0','新闻菜单1','新闻菜单2'],
        }
    },
    mounted () {
        let url = 'http://www.phonegap100.com/appapi.php?a=getPortalList&catid=20&page=1'
        this.$http.get(url).then((response)=> {
            console.log(response);
            this.list3 = response.body.result;
        },function(err) {
            console.log(err);
        })
    }
}
</script>

<style>

</style>
